#ifndef MOLAS_H
#define MOLAS_H
#include <list>


#include "ForcaMolas.h"
#define SEMAFORO
//#define TESTE_SEMAFORO

template<class T> class ELEMENT_LIST ;
class SPHERE ;
class SPRING ;
using namespace std;

class ListaMolas : public ForcaMolas
{
    public:
            ListaMolas(){}
            ListaMolas(MODEL*md);
            SPRING* Forca(SPRING*k);
            void calcular();
    protected:
            ELEMENT_LIST<SPRING>*molas;

    private:
};

class ListaMolasParalelo : public ListaMolas
{
    public:
        ListaMolasParalelo(MODEL*md);
        ~ListaMolasParalelo()
        {
            for (SPHERE* s = modelo->SPHList.Begin; s != NULL;s = s->Next) omp_destroy_lock(&(s->semaforo));
            delete modelo;
            delete molas;
        }
        SPRING* Forca(SPRING*k);
        void calcular();
    protected:
    private:
            list<SPRING*> remSequenc;
            void finalizaOperacoes();
            int qtdMolas;
};

#endif // MOLAS_H
